import Vue from 'vue'
import vuex from 'vuex'

Vue.use(vuex);

export default new vuex.Store({
  state: {
    id: '',
    admin: false,
    adminLogin: false,
    userFooter: false,
    userInfo: {},
    user: {},
    money:"",
    currentTitle: "",
    currentColor: ""
  },
  mutations: {
    initColor(state, b) {
      state.currentColor = b;
    },
    money(state, b) {
      state.money = b;
    },
    initTitle(state, b) {
      state.currentTitle = b;
    },
    switchUserFooter(state, b) {
      state.userFooter = b;
    },
    switchId(state, b) {
      state.id = b;
    },

    switchAdmin(state, b) {
      state.admin = b;
    },
    switchAdminLogin(state, b) {
      state.adminLogin = b;
    },
    setUserInfo(state, info) {
      state.userInfo = info;
    },
    setUser(state, info) {
      state.user = info;
    },
  },
})
